﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MCPlatform.MotionLib.Base.Environment
{
    public static class Paths
    {
        /// <summary>
        /// 电机配置地址
        /// </summary>
        public static string MotionConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_MotionConfigPaths))
                {
                    _MotionConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.MotionConfigPath;
                }  
                return _MotionConfigPaths;
            }
        }

        private static string? _MotionConfigPaths;


        /// <summary>
        /// 插补坐标轴配置地址
        /// </summary>
        public static string ImpMotionConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_ImpMotionConfigPaths))
                {
                    _ImpMotionConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.ImpMotionConfigPath;
                }
                return _ImpMotionConfigPaths;
            }
        }

        private static string? _ImpMotionConfigPaths;


        /// <summary>
        /// 气缸配置文件路径
        /// </summary>
        public static string ValveConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_ValveConfigPaths))
                {
                    _ValveConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.ValveConfigPath;
                }
                return _ValveConfigPaths;
            }
        }

        private static string? _ValveConfigPaths;



        /// <summary>
        /// IO配置文件路径
        /// </summary>
        public static string IOConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_IOConfigPaths))
                {
                    _IOConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.IOConfigPath;
                }
                return _IOConfigPaths;
            }
        }

        private static string? _IOConfigPaths;


        /// <summary>
        /// 点位配置地址
        /// </summary>
        public static string PointConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_PointConfigPaths))
                {
                    _PointConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.PointConfigPath;
                }
                return _PointConfigPaths;
            }
        }

        private static string? _PointConfigPaths;


        /// <summary>
        /// 串口配置地址
        /// </summary>
        public static string ComConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_ComConfigPaths))
                {
                    _ComConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.ComConfigPath;
                }
                return _ComConfigPaths;
            }
        }

        private static string? _ComConfigPaths;


        /// <summary>
        /// Modbus TCP配置地址
        /// </summary>
        public static string ModbusTcpConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_ModbusTcpConfigPaths))
                {
                    _ModbusTcpConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.ModbusTcpConfigPath;
                }
                return _ModbusTcpConfigPaths;
            }
        }

        private static string? _ModbusTcpConfigPaths;


        /// <summary>
        /// TCP 客户端路径
        /// </summary>
        public static string TcpClientConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_TcpClientConfigPaths))
                {
                    _TcpClientConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.TcpClientConfigPath;
                }
                return _TcpClientConfigPaths;
            }
        }

        private static string? _TcpClientConfigPaths;


        /// <summary>
        /// 客户配置文件路径
        /// </summary>
        public static string TextConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_TextConfigPaths))
                {
                    _TextConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.TestTxtConfigPath;
                }
                return _TextConfigPaths;
            }
        }

        private static string? _TextConfigPaths;


        /// <summary>
        /// 客户配置文件路径,高温配置
        /// </summary>
        public static string NumberProbeHeighTempeConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_NumberProbeHeighTempeConfigPaths))
                {
                    _NumberProbeHeighTempeConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.NumberProbeTxtHeighTempeConfigPath;
                }
                return _NumberProbeHeighTempeConfigPaths;
            }
        }

        private static string? _NumberProbeHeighTempeConfigPaths;


        /// <summary>
        ///  客户配置文件路径,低温配置
        /// </summary>
        public static string NumberProbeLowerTempeConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_NumberProbeLowerTempeConfigPaths))
                {
                    _NumberProbeLowerTempeConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.NumberProbeTxtLowerTempeConfigPath;
                }
                return _NumberProbeLowerTempeConfigPaths;
            }
        }

        private static string? _NumberProbeLowerTempeConfigPaths;


        /// <summary>
        /// 温度设置路径
        /// </summary>
        public static string NumberProbeTempeConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_NumberProbeLowerConfigPaths))
                {
                    _NumberProbeLowerConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.NumberProbeTxtTempeConfigPath;
                }
                return _NumberProbeLowerConfigPaths;
            }
        }

        private static string? _NumberProbeLowerConfigPaths;



        /// <summary>
        /// 产品配置地址
        /// </summary>
        public static string ProductConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_ProductConfigPaths))
                {
                    _ProductConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.ProductConfigPath;
                }
                return _ProductConfigPaths;
            }
        }

        private static string? _ProductConfigPaths;




        /// <summary>
        /// 设置地址
        /// </summary>
        public static string SettingConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_SettingConfigPaths))
                {
                    _SettingConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.SettingConfigPath;
                }
                return _SettingConfigPaths;
            }
        }

        private static string? _SettingConfigPaths;




        /// <summary>
        /// Dxf路径地址
        /// </summary>
        public static string DxfSavePaths
        {
            get
            {
                if (string.IsNullOrEmpty(_DxfSavePaths))
                {
                    _DxfSavePaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.DxfSavePath;
                }
                return _DxfSavePaths;
            }
        }

        private static string? _DxfSavePaths;


        /// <summary>
        /// Dxf配置地址
        /// </summary>
        public static string DxfConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_DxfConfigPaths))
                {
                    _DxfConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.DxfConfigPath;
                }
                return _DxfConfigPaths;
            }
        }

        private static string? _DxfConfigPaths;


        /// <summary>
        /// 刀具配置地址
        /// </summary>
        public static string ToolConfigPaths
        {
            get
            {
                if (string.IsNullOrEmpty(_ToolConfigPaths))
                {
                    _ToolConfigPaths = Path.GetDirectoryName(System.Environment.ProcessPath) + Fields.ToolConfigPath;
                }
                return _ToolConfigPaths;
            }
        }

        private static string? _ToolConfigPaths;
    }
}
